﻿<?php
defined("_VALID_ACCESS") || die('Direct access forbidden');
class SCTV_ChangeRequestInstall extends ModuleInstall {
    public function install() {		  
		Base_ThemeCommon::install_default_theme($this->get_type());
	
		$fields = array(
			array('name'=>_M('Requirement'), 'type'=>'select', 'param'=>array('SCTV_Requirement'=>'Requirement Code'), 'required'=>true, 'visible'=>true),
			array('name'=>_M('Request'), 'type'=>'text', 'param'=>256, 'required'=>true, 'visible'=>true),			
			array('name'=>_M('Status'), 'type'=>'checkbox', 'required'=>true, 'visible'=>true, 'extra'=>true, 'display_callback'=>array('SCTV_ChangeRequestCommon', 'display_status'), 'QFfield_callback'=>array('SCTV_ChangeRequestCommon', 'QFfield_status')),
			array('name'=>_M('Result'), 'type'=>'text', 'param'=>256, 'required'=>false, 'visible'=>true),			
		);		
		Utils_RecordBrowserCommon::install_new_recordset('SCTV_ChangeRequest', $fields);		
		Utils_RecordBrowserCommon::set_caption('SCTV_ChangeRequest', _M('Change Request'));
		Utils_RecordBrowserCommon::add_default_access('SCTV_ChangeRequest');
				
		Utils_RecordBrowserCommon::new_addon('SCTV_Requirement', 'SCTV_ChangeRequest', 'requirement_addon', _M('Change Request'));
		
        return true;
    }
 
    public function uninstall() {
		Base_ThemeCommon::uninstall_default_theme($this->get_type());
		Utils_RecordBrowserCommon::uninstall_recordset('SCTV_ChangeRequest');
		return true;		
    }
 
    public function info() {
        return array(
        	'Author'=>'Pham Huu Le Quoc Phuc',
            'License'=>'SCTV',
            'Description'=>'ChangeRequest');
    }
 
    public function simple_setup() { 
        return array('package' => __('Change Request'), 'version'=>'1.0');
    }
 
    public function requires($v) {
        return array();
    }
 
    public function version() {
        return array('1.0');
    }
}
 
?>